package com.mini.wechat.miniwechat.utils;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import jodd.http.HttpRequest;
import jodd.http.HttpResponse;

/**
 * @program: imall-service
 * @description: httpUtils工具类
 * @author: 王学伟
 * @create: 2018-11-09 16:08
 **/
public class HttpUtils {

	/**
	 * http get请求直接返回Page
	 * @return
	 */
	public static JSONObject getHttpToJSONObject(String url){
		HttpResponse response = HttpRequest
				.get(url)
				.send()
				.acceptEncoding("utf-8")
//				.formEncoding("utf-8")
				.charset("utf-8");
			JSONObject jsonObject = JSON.parseObject(response.bodyText());

		return jsonObject;
	}


}
